import { getBusinessList,getBusinessTotal } from '../../utils/api'
export default {
    namespaced: true,
    state: {
        businessList: [],
        businessTotal:0
    },
    mutations: {
        businessListInit(state, payload) {
            state.businessList = payload
        },
        businessTotalInit(state, payload) {
            state.businessTotal = payload
        }
    },
    actions: {
        // payload={page,size}
        async getBusinessListAction({ commit }, payload) {
            const { data } = await getBusinessList(payload)
            if (data.code === 200) {
                commit('businessListInit', data.data)
            }
        },
        async getBusinessTotalAction({ commit }) {
            const { data } = await getBusinessTotal()
            if (data.code === 200) {
                commit('businessTotalInit', data.data)
            }
        }
    }
}